package com.neudu.glsb.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 产品信息
 * @TableName products
 */
@TableName(value ="products")
@Data
public class Products implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品价格
     */
    private BigDecimal price;

    /**
     * 产品描述
     */
    private String description;

    /**
     * 产品是否可用
     */
    private Integer isAvailable;

    /**
     * 制作该饮品所需的原料总成本
     */
    private BigDecimal ingredientCost;

    /**
     * 制作该饮品所需的大致时长（分钟）
     */
    private Integer preparationTime;

    /**
     * 商品照片的路径或链接
     */
    private String imageUrl;

    /**
     * 商品种类
     */
    private String productCategory;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Products other = (Products) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
                && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
                && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
                && (this.getIsAvailable() == null ? other.getIsAvailable() == null : this.getIsAvailable().equals(other.getIsAvailable()))
                && (this.getIngredientCost() == null ? other.getIngredientCost() == null : this.getIngredientCost().equals(other.getIngredientCost()))
                && (this.getPreparationTime() == null ? other.getPreparationTime() == null : this.getPreparationTime().equals(other.getPreparationTime()))
                && (this.getImageUrl() == null ? other.getImageUrl() == null : this.getImageUrl().equals(other.getImageUrl()))
                && (this.getProductCategory() == null ? other.getProductCategory() == null : this.getProductCategory().equals(other.getProductCategory()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getIsAvailable() == null) ? 0 : getIsAvailable().hashCode());
        result = prime * result + ((getIngredientCost() == null) ? 0 : getIngredientCost().hashCode());
        result = prime * result + ((getPreparationTime() == null) ? 0 : getPreparationTime().hashCode());
        result = prime * result + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode());
        result = prime * result + ((getProductCategory() == null) ? 0 : getProductCategory().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", productName=").append(productName);
        sb.append(", price=").append(price);
        sb.append(", description=").append(description);
        sb.append(", isAvailable=").append(isAvailable);
        sb.append(", ingredientCost=").append(ingredientCost);
        sb.append(", preparationTime=").append(preparationTime);
        sb.append(", imageUrl=").append(imageUrl);
        sb.append(", productCategory=").append(productCategory);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}